home *** CD-ROM | disk | FTP | other *** search
- MODULE menu;
-
- IMPORT GEMVDIbase, AESGraphics, AESMenus, AESEvents, GEMAESbase;
- FROM VDIInputs IMPORT ShowCursor,HideCursor;
-
- FROM SYSCALL IMPORT EnableSpint;
-
- FROM MYLIB IMPORT InitResource,MenuTree,Terminate;
-
- FROM SYSTEM IMPORT ADR,ADDRESS;
- FROM GEMDOS IMPORT OldTerm;
-
- CONST
- resourcefilename="MENU.RSC" ;
- message = 4;
- CONST
- MENU1 = 0 ;
- EXITMENU = 4 ;
- DESKMENU = 5 ;
- MEXIT = 17 ;
- CURSOR = 19 ;
-
-
- VAR resourcename : ARRAY [0..99] OF CHAR ;
- result,handle : INTEGER ;
- done : BOOLEAN ;
- eventbits : BITSET;
- bufadr : ADDRESS;
-
- (* ------------------------------------------------------------------- *)
-
- PROCEDURE quit;
- BEGIN
- done:=TRUE;
- END quit;
-
- PROCEDURE Events ;
- (* Handle resource events *)
- VAR
- pipeBuff : ARRAY [0..9] OF INTEGER ;
- Menu : INTEGER;
-
-
- PROCEDURE SelectMenu( Menu, Item : INTEGER ) ;
- BEGIN
- CASE Menu OF
- DESKMENU : CASE Item OF
- CURSOR : ShowCursor(handle,0); |
- ELSE
- END ; |
- EXITMENU : done:=TRUE; |
- ELSE
- END ;
- (* put header back normal*)
- AESMenus.MenuTitleNormal(MenuTree,Menu,1) ;
- END SelectMenu ;
-
- BEGIN
- done := FALSE ;
- bufadr:=ADR(pipeBuff);
- AESGraphics.GrafMouse(GEMAESbase.Arrow,NIL) ; (* put pointing mouse *)
- REPEAT
- eventbits:=BITSET(AESEvents.EventMultiple(48,0,0,0,
- 0,0,0,0,0,
- 0,0,0,0,0,
- bufadr,
- 0,0,
- result,result,result,result,
- result,result));
- IF message IN eventbits THEN
- CASE pipeBuff[0] OF (* message type *)
- GEMAESbase.MenuSelected : SelectMenu(pipeBuff[3],pipeBuff[4]) ; |
- ELSE
- END ;
- END;
- UNTIL done ;
- HideCursor(handle);
- END Events ;
-
- BEGIN
- handle:=InitResource(resourcefilename,MENU1);
- IF handle#(-1) THEN
- done:=EnableSpint(1,quit,NIL);
- Events;
- Terminate;
- END;
- OldTerm;
- END menu.
-